import request from "../utils/service";
import vue from "../main"
import systemApi from "./systemApi";
import workflowApi from "./workflowApi";


//校验字段是否重复
function count(tableName, data) {
    return request('/common/check/repeat/' + tableName + '/', data);
}

//分页查询列表
function page(tableName, data) {
    return request('/common/page/' + tableName + '/', data)
}


function popoverSuccessMessage(res) {
    vue.$message({ message: res.data.msg, type: 'success' })
}

function popoverErrorMessage(reject) {
    vue.$message({ message: reject, type: 'error' })
}


//导出系统管理api
export { systemApi, workflowApi };


export const commonApi = {
    //弹出提示
    popoverSuccessMessage,
    popoverErrorMessage,

    //通用
    count,
    page,
}